#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using pii = pair < int , int >;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 1e5 + 10;

struct modi {
	int op, a, b, c;
} p[N << 1], q[N << 1];

int s[N], t[N], ans[N];

int vpot[N << 1], cnt, n, Q;

namespace T {
	int tr[N << 1];
	void add(int x, int v) { for(; x; x -= x & -x) tr[x] += v; }
	int query(int x) { int res = 0; for(; x <= cnt; x += x & -x) res += tr[x]; return res; }
}

void solve(int l, int r) {
	if(l == r) return; int mid = l + r >> 1;
	solve(l, mid); solve(mid + 1, r);
	int top = 0, p1 = l, p2 = mid + 1;
	while(p1 <= mid && p2 <= r) {
		if(p[p1].b >= p[p2].b) {
			q[++top] = p[p1];
			if(p[p1].op == 0) T :: add(p[p1].c, 1);
			p1++;
		} else {
			q[++top] = p[p2];
			if(p[p2].op != 0) ans[p[p2].op] += T :: query(p[p2].c);
			p2++;
		}
	}
	while(p2 <= r) { if(p[p2].op != 0) ans[p[p2].op] += T :: query(p[p2].c); p2++; }
	rep(i, p1, mid) q[++top] = p[i];
	p1--; while(p1 >= l) { if(p[p1].op == 0) T :: add(p[p1].c, -1); p1--; }
	rep(i, l, l + top - 1) p[i] = q[i - l + 1];
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in, Q = in;
	rep(i, 1, n) s[i] = in, t[i] = in, vpot[++cnt] = s[i] + t[i], p[i] = (modi){ 0, s[i], t[i], s[i] + t[i] };
	rep(i, 1, Q) {
		int a = in, b = in, c = in;
		p[n + i] = { i, a, b, c }; vpot[++cnt] = c; 
	}
	sort(vpot + 1, vpot + cnt + 1); cnt = unique(vpot + 1, vpot + cnt + 1) - vpot - 1;
	rep(i, 1, n + Q) p[i].c = lower_bound(vpot + 1, vpot + cnt + 1, p[i].c) - vpot;
	sort(p + 1, p + n + Q + 1, [](auto a, auto b) { return a.a ^ b.a ? a.a > b.a : a.b ^ b.b ? a.b > b.b : a.c ^ b.c ? a.c > b.c : a.op < b.op; });
	solve(1, n + Q);
	rep(i, 1, Q) printf("%d\n", ans[i]); return 0;
}
